Cyclic Redundancy Check (CRC) is an important aspect in the error-detecting capabilities of many protocols, such as the Ethernet local area network, protocol. CRC provides a number of bits (usually 16 or 32) generated from, and appended to the end of, a block of data to provide error detection. A message receiver generates a CRC from the block of data and compares it to the CRC appended to the received message. If the appended CRC matches the generated CRC, then there is a high probability that the received message has not been corrupted.
One standard 16-bit generator polynomial is represented by x16+x12+x5+1. The polynomial represents the binary number 10001000000100001—a one bit is in positions 16, 12, 5, and 0. The CRC is the remainder after binary (modulo 2) division of the message by the generator polynomial. For Ethernet CRC, the 32-bit generator polynomial is represented by x32+x26+x23+x22+x16+x12+X11+x10+X8+x7+x5+x4+x2+x+1. Typically, a 16-bit CRC generator polynomial is used with messages of less than 4 Kbytes. A 32-bit CRC generator is used for messages up to 64 kbytes in length.
The CRC is usually performed by the data link protocol and a calculated CRC is appended to the end of the data link layer frame. The CRC is calculated by performing a modulo 2 division of the data by a generator polynomial and recording the remainder after division.
Although this division may be performed in software, it is commonly performed using a shift register and exclusive or X-OR gates. The hardware solution for implementing a CRC is much simpler than a software approach. The CRC-16 is able to detect all single errors, all double errors, and all errors with bursts less than 16 bits in length. The previously-standardized CRC-16 generator polynomials can also detect all odd numbers of errors, at the expense of less detection capability for even numbers of errors.
On an aside, the CRC is the only field which is by convention sent most significant bit first. To further clarify, the first bit of the CRC-16 to be sent is the bit corresponding to position 16 in the CRC field, the most significant bit (MSB), and the last bit being the bit corresponding to position 0 in CRC field, the least significant bit (LSB).
As previously mentioned, CRC is pervasive throughout most data traffic. Recently, a protocol, known as the Generic Framing Procedure (GFP), utilizes a CRC-16 for error detection and correction in the frame header and payload. GFP also utilizes an X43+1 slef-synchronous scrambler, for receiver synchronization protection. The GFP protocol has recently been standardized by the International Telecommunications Union—Telecommunications (ITU-T) as Recommendation G. 7041.
To date, GFP has been implemented as a generic mechanism to adapt traffic from higher-layer signals over a synchronous transport network. There are two types of GFP, the frame-mapped GFP and the transparent GFP. The frame-mapped GFP enables a signal frame to be received and mapped in its entirety into one or more GFP frames. The transparent GFP mapping involves decoding block-coded signal frames and then mapping the decoded signal frames into a fixed-length GFP frame, having only received a block-coded version of the signal frame.
Prior to transmitting a GFP frame, the payload portion of the GFP frame is normally scrambled. Frames are scrambled to protect a user from other malicious users who may try to cause loss of receiver synchronization at the physical layer. For the SONET/SDH protocol (Synchronous Optical Network/Synchronous Digital Hierarchy), self-synchronized scramblers are utilized to create more physical layer transitions to aid timing recovery at the receiver. The frame-synchronized scrambler was added to make it much more difficult for a malicious user to defeat the effects of the frame synchronous scrambler.
A frame-synchronized scrambler is one in which the transmitted data is exclusive-ORed bit-by-bit with the output of a pseudo-random sequence generator with the sequence generator being reset to a known state at the beginning of every frame. The frame-synchronized scramblers are very effective in increasing the transition density to an acceptable level for typical traffic. One drawback of a frame-synchronized scrambler is that it is a known, relatively short (27-1) pseudo-random sequence and it is possible for a malicious subscriber to attempt to mimic this pattern within the data he sends. The result is that if the subscriber data lines up with the SONET/SDH scrambler correctly, a long string can occur with no transitions, which in turn can cause the receiver to fail. The phenomenon was observed with early ATM and POS systems and was addressed from the outset with GFP. The solution used for each of these three protocols is a self-synchronous scrambler over the payload region of the cell/frame.
A self-synchronous scrambler is one in which the data is exclusive-ORed with a delayed version of itself on a bit-by-bit basis. The specific scrambler used for ATM, POS, and GFP exclusive-ORs the input data with scrambler output data after a 43 bit delay termed the scrambler polynomial. The descrambler reverses the process by multiplying the received signal by the same scrambler polynomial. The advantage to such a scrambler in this application is that it is very hard for a malicious user to duplicate due to its never having a known reset point. The value of the scrambler state is a function of the previous data rather than the position of the data within the SONET/SDH frame. The drawback to a self-synchronous scrambler is that any errors occurring on the transmission channel will be duplicated 43 bits later by the descrambler. As a result, an error check code over the data will have to deal with twice the bit error rate as that experienced by the transmission channel.
The duplicated bit error, hereinafter termed the “double bit error”, requires that the decoded CRC detect the double bit errors, as well as any single bit errors, without compromising the probability of detection. In view of aforementioned shortcomings of the self-synchronous scrambler, the present invention seeks to provide a circuit for detecting and correcting both single bit errors and double bit errors based on a plurality of conditions being met. The present invention further seeks to provide a probability of error detection that is equivalent to the probability of error detection had the double errors not been introduced by the descrambler.